<?php

namespace app\common\enum;

/**
 * 预约订单状态
 * Class OrderType
 * @package app\common\enum
 */
class AppointmentStatus extends EnumBasics
{
    // 未使用
    const UnUsed = 1;

    // 已使用
    const Used = 2;

    // 取消服务
    const Cancel = 3;

    /**
     * 获取订单类型值
     * @return array
     */
    public static function data()
    {
        return [
            self::UnUsed => [
                'name' => '未服务',
                'value' => self::UnUsed,
            ],
            self::Used => [
                'name' => '已服务',
                'value' => self::Used,
            ],
            self::Cancel => [
                'name' => '取消服务',
                'value' => self::Cancel,
            ],
        ];
    }

    /**
     * 获取订单类型名称
     * @return array
     */
    public static function getTypeName()
    {
        static $names = [];
        if (empty($names)) {
            foreach (self::data() as $item)
                $names[$item['value']] = $item['name'];
        }
        return $names;
    }

}